<template>
	<div class="info-bg">
		<div class="info-bg-topnav">
			<base-topnav :topnav=topnav></base-topnav>
		</div>
		<div class="info-schoolbg">
			<div class="info-schoolbg-container">
				<div :class="type" class="info-avatar">
					<img v-if="type=='school'" :src="d.introduce.logo?(base.api('logo')+d.introduce.logo):''" alt="" />
				</div>
				<ul>
					<li v-if="type=='school'">{{d.introduce.sname}} <span><span class="jcyui-icon-location"></span> {{d.introduce.city_name}}</span>
					</li>
					<li v-if="type=='major'">{{d.intro.major_name}}</li>
					<li v-if="type=='school'">
						<span v-if="d.introduce.nef">{{d.introduce.nef}}</span>
						<span>{{d.introduce.too}}</span>
						<span>{{d.introduce.rank_name}}</span>
						<span>薪酬超过{{d.introduce.salary}}%的学校</span>
					</li>
					<li v-if="type=='school'">
						<span>进入官方网站>></span>
						<span>电话：025-00000000</span>
					</li>
					<li v-if="type=='major'" class="info-code">
						<span>专业代码：{{d.intro.code}}</span>
					</li>
				</ul>
				<div v-if='type=="school"' class="info-paiming">
					<span>综合排名:</span>
					<span>{{d.introduce.ranking}}</span>
					<div class="info-attention" v-if="d.base_data.status" @click="attention">
						<info-icon5></info-icon5>
					</div>
					<div class="info-attention" v-if="!d.base_data.status" @click="attention">
						<info-icon6></info-icon6>
					</div>
				</div>
				<div v-if='type=="major"' class="info-paiming">
					综合排名:
					<span>{{d.job.prospect.salary}}</span>
					<div class="info-attention" v-if="d.status" @click="attention">
						<info-icon5></info-icon5>
					</div>
					<div class="info-attention" v-if="!d.status" @click="attention">
						<info-icon6></info-icon6>
					</div>
				</div>
			</div>

		</div>
	</div>
</template>
<script>
	'use strict';

module['info-bg'] = { //网页中间部分的使用一个大背景图的组件
	props: ['type', 'd'],
	components: {
		'base-topnav': require('base-topnav')
	},
	data: function data() {
		var froms = this.d.from;
		var a = {
			name: '首页',
			router: '/index'
		};
		var b, c, d;
		if (froms[0] == 'collage') {
			var o = '/recommond';
			var e = ['按分推荐大学', '智能填志愿', '模拟填志愿', '录取率测试', '成绩分析报告', '看就业选学校', '看就业选专业', '看职业选专业'];
			b = {
				name: '院校推荐',
				router: o
			};
			c = {
				name: e[froms[1]],
				router: o + '?index=' + froms[1]
			};
		} else if (froms[0] == 'info') {
			var o = '/infolib';
			var e = ['院校大全', '专业大全', '大学排行', '专业排行', '真假院校'];
			b = {
				name: '信息库',
				router: o
			};
			c = {
				name: e[froms[1]],
				router: o + '?index=' + froms[1]
			};
		} else {
			b = {
				name: '',
				router: ''
			};
			c = {
				name: '',
				router: ''
			};
		}
		if (this.type == 'school') {
			d = {
				name: '院校详情',
				router: '/info'
			};
		} else {
			d = {
				name: '专业详情',
				router: '/info'
			};
		}
		return {
			topnav: [a, b, c, d]
		};
	},
	template: template,
	created: function created() {},
	methods: {
		attention: function attention(e) {
			if (this.type == 'school') {
				attentionAjax.call(this, init.vm.d.base_data, id);
			} else {
				attentionAjax.call(this, init.vm.d, id);
			}
		}
	}
};
</script>
<style>
	.info-bg-topnav{
		margin:0 auto;
		width:1200px;
	}
</style>